#include "threadPool.hpp"
#include <memory>
#include <cstdlib>
#include <unistd.h>
void CallBack(const int& val)
{
    cout << "处理了一个任务：" << val << endl; 
}
int main()
{
    unique_ptr<ThreadPool<int>>tp(new ThreadPool<int>(CallBack));
    tp->Init();
    tp->Start();

    while(true)
    {
        int t = rand() % 100;
        tp->PushTask(t);
        cout << "生产了一个任务：" << t << endl;
        sleep(1);
    }

    return 0;
}